from django.db import models

from myuser.models import MyUser
from prj004.models.models import CreateTimeModel
from prj004.models.info import Info


class Clinical(CreateTimeModel):
    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj004_clinical')

    info = models.OneToOneField(Info, related_name='clinical', on_delete=models.CASCADE)

    zhong_hua = models.BooleanField(default=False, blank=True, verbose_name='滑胎', help_text='滑胎')

    zhong_hebing = models.BooleanField(default=False, blank=True, verbose_name='合并', help_text='合并')

    zhong_hebing_yue = models.BooleanField(default=False, blank=True, verbose_name='月经病', help_text='月经病')

    zhong_hebing_dai = models.BooleanField(default=False, blank=True, verbose_name='带下病', help_text='带下病')

    zhong_hebing_xia = models.BooleanField(default=False, blank=True, verbose_name='癥瘕', help_text='癥瘕')

    zhong_hebing_fu = models.BooleanField(default=False, blank=True, verbose_name='妇科杂病', help_text='妇科杂病')

    zhong_hebing_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='合并疾病-其他', help_text='合并疾病-其他')

    ZHONG_XU_CHOICES = (
        ('肾气虚证', '肾气虚证'),
        ('肾阴虚证', '肾阴虚证'),
        ('肾阳虚证', '肾阳虚证'),
        ('肾阴阳两虚证', '肾阴阳两虚证'),
        ('脾肾不足证', '脾肾不足证'),
        ('气血两虚证', '气血两虚证'),
        ('气阴不足证', '气阴不足证')
    )
    zhong_xu = models.CharField(choices=ZHONG_XU_CHOICES, max_length=10, null=True, blank=True, verbose_name='辨证分型-虚症', help_text='辨证分型-虚症')
    zhong_xu_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='虚证-其他', help_text='虚证-其他')

    ZHONG_SHI_CHOICES = (
        ('痰湿证', '痰湿证'),
        ('血瘀证', '血瘀证'),
        ('肝郁气滞证', '肝郁气滞证')
    )
    zhong_shi = models.CharField(choices=ZHONG_SHI_CHOICES, max_length=10, null=True, blank=True, verbose_name='辨证分型-实证', help_text='辨证分型-实证')

    zhong_shi_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='实证-其他', help_text='实证-其他')

    ZHONG_XUSHI_CHOICES = (
        ('肾虚血瘀证', '肾虚血瘀证'),
        ('肝郁肾虚证', '肝郁肾虚证'),
        ('气虚血瘀证', '气虚血瘀证')
    )
    zhong_xushi = models.CharField(choices=ZHONG_XUSHI_CHOICES, max_length=10, null=True, blank=True, verbose_name='辨证分型-虚实夹杂证', help_text='辨证分型-虚实夹杂证')

    zhong_xushi_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='虚实夹杂证-其他', help_text='虚实夹杂证-其他')

    xi_fufa = models.BooleanField(default=False, blank=True, verbose_name='复发性流产', help_text='复发性流产')

    xi_hebing = models.BooleanField(default=False, blank=True, verbose_name='合并疾病', help_text='合并疾病')

    xi_hebing_pen = models.BooleanField(default=False, blank=True, verbose_name='盆腔炎性疾病', help_text='盆腔炎性疾病')

    xi_hebing_yiwei = models.BooleanField(default=False, blank=True, verbose_name='子宫内膜异位症', help_text='子宫内膜异位症')

    xi_hebing_xianji = models.BooleanField(default=False, blank=True, verbose_name='子宫腺肌症', help_text='子宫腺肌症')

    xi_hebing_duo = models.BooleanField(default=False, blank=True, verbose_name='多囊卵巢综合征', help_text='多囊卵巢综合征')

    xi_hebing_jiliu = models.BooleanField(default=False, blank=True, verbose_name='子宫肌瘤', help_text='子宫肌瘤')

    xi_hebing_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='合并疾病-其他', help_text='合并疾病-其他')

    def __str__(self):
        return '{}-{}'.format(self.owner, self.info)

    class Meta:
        verbose_name = '临床诊断'
        verbose_name_plural = verbose_name
